export async function request(options: WechatMiniprogram.RequestOption<string | Record<string, any> | ArrayBuffer>, success = () => { }, fail = () => { }) {
  return new Promise<WechatMiniprogram.RequestSuccessCallbackResult<string | Record<string, any> | ArrayBuffer>>((resolve, reject) => {
    wx.request({
      ...options,
      // 404等也会走success这个方法
      success: (res) => {
        resolve(res)
      },
      fail: (reason) => {
        reject(reason)
      }
    })
  })
}